gtkpopover: set background and popover css classes
authorLars Uebernickel <lars.uebernickel@canonical.com>
Wed, 18 Jun 2014 11:13:30 +0000 (13:13 +0200)
committerLars Uebernickel <lars.uebernickel@canonical.com>
Wed, 18 Jun 2014 12:24:14 +0000 (14:24 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=731834

gtk/gtkpopover.c
gtk/gtkstylecontext.h

index 089e8e948aa808ca29c7a84d69ff4c9e034b1b45..b660a904b4e40d0de6ef63465035acd4aff6ef09 100644 (file)
@@ -153,12 +153,17 @@ static void
 gtk_popover_init (GtkPopover *popover)
 {
   GtkWidget *widget;
+  GtkStyleContext *context;
 
   widget = GTK_WIDGET (popover);
   gtk_widget_set_has_window (widget, TRUE);
   popover->priv = gtk_popover_get_instance_private (popover);
   popover->priv->modal = TRUE;
   popover->priv->apply_shape = TRUE;
+
+  context = gtk_widget_get_style_context (widget);
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_BACKGROUND);
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_POPOVER);
 }
 
 static void
index 680461621844758e065f22a3e758a0d66f26bd98..4967d45f473cce189622be3a2eac5fa2a10e9bf2 100644 (file)
@@ -796,6 +796,15 @@ struct _GtkStyleContextClass
  */
 #define GTK_STYLE_CLASS_DESTRUCTIVE_ACTION "destructive-action"
 
+/**
+ * GTK_STYLE_CLASS_POPOVER:
+ *
+ * A CSS class that matches popovers. Used by #GtkPopover.
+ *
+ * Since: 3.14
+ */
+#define GTK_STYLE_CLASS_POPOVER "popover"
+
 /* Predefined set of widget regions */
 
 /**